<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/5/21
  Time: 20:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

    <title>订单管理</title>

    <link href="${path}/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="${path}/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

    <link href="${path}/css/personal.css" rel="stylesheet" type="text/css">
    <link href="${path}/css/orstyle.css" rel="stylesheet" type="text/css">

    <script src="${path}/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="${path}/AmazeUI-2.4.2/assets/js/amazeui.js"></script>

    <!-- layui的js -->
    <script src="${path}/layuiadmin/layui/layui.js" charset="utf-8"></script>
    <!-- layui使用的样式-->
    <link rel="stylesheet" href="${path}/layuiadmin/layui/css/layui.css" media="all">

</head>

<body>
<article>
    <div class="mt-logo">
        <!--头 -->
        <header>
            <jsp:include page="header.jsp"></jsp:include>
        </header>
    </div>
</article>
<div class="nav-table">
    <div class="long-title"><span class="all-goods">全部分类</span></div>
    <jsp:include page="navigation.jsp"></jsp:include>
</div>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <div class="user-order">

                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> /
                        <small>Order</small>
                    </div>
                </div>
                <hr/>

                <div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

                    <ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
                        <li class="am-active"><a href="#tab1">普通订单</a></li>
                        <li><a href="#tab2">秒杀订单</a></li>
                        <!-- <li><a href="#tab3">待发货</a></li>
                         <li><a href="#tab4">待收货</a></li>
                         <li><a href="#tab5">待评价</a></li>-->
                    </ul>

                    <div class="am-tabs-bd">
                        <!--普通订单模块开始-->
                        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list">

                                    <c:forEach items="${orders}" var="order" varStatus="status">
                                        <div class="order-status5">
                                            <div class="order-title">
                                                <div class="dd-num">订单编号：<a href="javascript:;">${order.ordernum}</a>
                                                </div>
                                                <span>下单时间：${listTime[status.index]}</span>
                                            </div>
                                            <div class="order-content">
                                                <div class="order-left">
                                                    <c:forEach items="${order.list}" var="orderlist">
                                                        <ul class="item-list">
                                                            <li class="td td-item">
                                                                <div class="item-pic">
                                                                    <a href="#" class="J_MakePoint">
                                                                        <img src="${path}${orderlist.pictureurl}"
                                                                             class="itempic J_ItemImg">
                                                                    </a>
                                                                </div>
                                                                <div class="item-info">
                                                                    <div class="item-basic-info">
                                                                        <a href="#">
                                                                            <p>${orderlist.goodstitle}</p>
                                                                                <%-- <p class="info-little">颜色：12#川南玛瑙
                                                                                     <br/>包装：裸装 </p>--%>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <li class="td td-price">
                                                                <div class="item-price">
                                                                    ￥：${orderlist.goodsprice}
                                                                </div>
                                                            </li>
                                                            <li class="td td-number">
                                                                <div class="item-number">
                                                                    <span>×</span>${orderlist.goodsnum}
                                                                </div>
                                                            </li>
                                                            <li class="td td-operation">
                                                                <div class="item-operation">

                                                                </div>
                                                            </li>
                                                        </ul>
                                                    </c:forEach>

                                                </div>
                                                <div class="order-right">
                                                    <li class="td td-amount">
                                                        <div class="item-amount">
                                                            合计：￥:${order.ordersalary}
                                                        </div>
                                                    </li>
                                                    <div class="move-right">
                                                            <%-- <li class="td td-status">
                                                                 <div class="item-status">
                                                                     <p class="Mystatus">交易成功</p>
                                                                     <p class="order-info"><a href="orderinfo.html">订单详情</a></p>
                                                                     <p class="order-info"><a href="logistics.html">查看物流</a></p>
                                                                 </div>
                                                             </li>
                                                             <li class="td td-change">
                                                                 <div class="am-btn am-btn-danger anniu">
                                                                     删除订单</div>
                                                             </li>--%>
                                                        <c:if test="${order.orderstatus==0}">
                                                            <li class="td td-status">
                                                                <div class="item-status">
                                                                    <p class="Mystatus">未付款</p>
                                                                    <p><a href="${path}/user.action/toOrderInfo?orderid=${order.orderid}">订单详细</a></p>
                                                                </div>
                                                            </li>
                                                            <li class="td td-change">
                                                                <div class="am-btn am-btn-danger anniu">
                                                                    一键支付
                                                                </div>
                                                            </li>
                                                        </c:if>
                                                        <c:if test="${order.orderstatus==1}">
                                                            <li class="td td-status">
                                                                <div class="item-status">
                                                                    <p class="Mystatus">待发货</p>
                                                                    <p><a href="${path}/user.action/toOrderInfo?orderid=${order.orderid}">订单详细</a></p>
                                                                </div>
                                                            </li>
                                                            <li class="td td-change">
                                                                <a target="_blank"
                                                                   href="http://wpa.qq.com/msgrd?v=3&uin=1403672737&site=qq&menu=yes">
                                                                    <div class="am-btn am-btn-danger anniu">
                                                                        提醒发货
                                                                    </div>
                                                                </a>
                                                            </li>
                                                        </c:if>
                                                        <c:if test="${order.orderstatus==2}">
                                                            <li class="td td-status">
                                                                <div class="item-status">
                                                                    <p class="Mystatus">已发货</p>
                                                                    <p><a href="${path}/user.action/toOrderInfo?orderid=${order.orderid}">订单详细</a></p>
                                                                </div>
                                                            </li>
                                                            <li class="td td-change">
                                                                <div class="am-btn am-btn-danger anniu"
                                                                     onclick="confirm1(${order.orderid})">
                                                                    确认收货
                                                                </div>
                                                            </li>
                                                        </c:if>
                                                        <c:if test="${order.orderstatus==3}">
                                                            <li class="td td-status">
                                                                <div class="item-status">
                                                                    <p class="Mystatus">已完成</p>
                                                                    <p><a href="${path}/user.action/toOrderInfo?orderid=${order.orderid}">订单详细</a></p>
                                                                </div>
                                                            </li>
                                                            <li class="td td-change">
                                                                <div class="am-btn am-btn-danger anniu" id="delete"
                                                                     onclick="deleteorder(${order.orderid})">
                                                                    删除订单
                                                                </div>
                                                            </li>
                                                        </c:if>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </c:forEach>
                                </div>

                            </div>

                        </div>
                        <!--普通订单模块结束-->
                        <!--秒杀订单模块开始-->
                        <div class="am-tab-panel am-fade" id="tab2">

                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" id="flashorderlist">
                                    <div class="order-status1">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">1601430</a></div>
                                            <span>成交时间：2015-12-20</span>

                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img src="${path}/images/kouhong.jpg_80x80.jpg"
                                                                     class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>美康粉黛醉美唇膏 持久保湿滋润防水不掉色</p>
                                                                    <p class="info-little">颜色：12#川南玛瑙
                                                                        <br/>包装：裸装 </p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            333.00
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>2
                                                        </div>
                                                    </li>
                                                    <li class="td td-operation">
                                                        <div class="item-operation">

                                                        </div>
                                                    </li>
                                                </ul>

                                                <ul class="item-list">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img src="${path}/images/62988.jpg_80x80.jpg"
                                                                     class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>礼盒袜子女秋冬 纯棉袜加厚 韩国可爱 </p>
                                                                    <p class="info-little">颜色分类：李清照
                                                                        <br/>尺码：均码</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            333.00
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>2
                                                        </div>
                                                    </li>
                                                    <li class="td td-operation">
                                                        <div class="item-operation">

                                                        </div>
                                                    </li>
                                                </ul>

                                                <ul class="item-list">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img src="${path}/images/kouhong.jpg_80x80.jpg"
                                                                     class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>美康粉黛醉美唇膏 持久保湿滋润防水不掉色</p>
                                                                    <p class="info-little">颜色：12#川南玛瑙
                                                                        <br/>包装：裸装 </p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            333.00
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>2
                                                        </div>
                                                    </li>
                                                    <li class="td td-operation">
                                                        <div class="item-operation">

                                                        </div>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        合计：676.00
                                                        <p>含运费：<span>10.00</span></p>
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <div class="item-status">
                                                            <p class="Mystatus">等待买家付款</p>
                                                            <p class="order-info"><a href="#">取消订单</a></p>

                                                        </div>
                                                    </li>
                                                    <li class="td td-change">
                                                        <a href="pay.html">
                                                            <div class="am-btn am-btn-danger anniu">
                                                                一键支付
                                                            </div>
                                                        </a>
                                                    </li>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>

                        <!--秒杀订单模块结束-->

                    </div>

                </div>
            </div>
        </div>
        <!--底部-->
        <div class="footer">

            <div class="footer-bd">
                <p>
                    <em>Copyright © 2006-2019 YONGHUI SUPERSTORES, All Rights Reserved小馋猫超市·版权所有 中国福建省厦门市软园24号
                        客服中心：86-591-83758880 4000601933</em>
                </p>
            </div>

        </div>
    </div>
    <jsp:include page="aside.jsp"></jsp:include>
</div>

<script>
    //***********页面加载
    $(function () {//判断用户是否登录
        var userid = "${user.userid}" + "a";
        if (userid != "a") {
            layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage, layer = layui.layer;
                //  layer.msg('玩命提示中');
                // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
            })
            getOrderMessage();
        } else {
            window.location.href = ${path}+"/login";
        }
    })

    //***********请求订单的详细信息**************
    function getOrderMessage() {
        $.ajax({
            url: "${path}/flashorder.action/showuserallorderinfo",
            type: "GET",
            data: {
                uid: "${user.userid}"
            },
            success: function (data) {
                if (data.code == 0) {//有活动数据
                    //数据展示模块
                    var dataMessage = data.data;
                    $("#flashorderlist").empty();
                    $.each(data.data, function (i) {
                        //数据展示
                        showFlashOrderMessage(data.data[i]);
                    })
                } else {//没有活动数据，返回错误信息
                    layer.msg(data.msg, {icon: 2, time: 1200});
                }
            },
            error: function () {
                layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage, layer = layui.layer;
                    //  layer.msg('玩命提示中');
                    // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                    $("#flashorderlist").empty()
                    // layer.msg("无秒杀订单",{icon : 2,time : 1200},function () {
                    //进行页面刷新
                    // getOrderMessage();
                    // });
                })
            }
        });
    }

    //秒杀订单的展示
    function showFlashOrderMessage(dataMessage) {
        var sureusername = dataMessage.sureusername;      //收件人名字
        var sureusertel = dataMessage.sureusertel;        //手机号
        var address = dataMessage.address;                //详细地址
        var orderNum = dataMessage.orderNum;               //订单号
        var sureshopnum = dataMessage.sureshopnum;         //秒杀商品数量
        var orderdata = dataMessage.orderdata;               //下单时间
        var surepice = dataMessage.surepice;                //价格
        var goodid = dataMessage.goodid;                    //商品ID
        var goodname = dataMessage.goodname;                 //商品名字
        var onelevelid = dataMessage.onelevelid;            //对应一级分类id
        var onelevelname = dataMessage.onelevelname;         //对应一级分类名称
        var twolevelid = dataMessage.twolevelid;            //对应二级分类Id;
        var twolevelname = dataMessage.twolevelname;        //对应二级分类名称
        var orderstatus = dataMessage.orderstatus;            //订单状态
        var priceurl = dataMessage.priceurl;                  //商品图片路径
        var allpice = surepice * sureshopnum;                    //总价
        var flashorderid = dataMessage.flashorderid;            //订单Id
        var anniu = '<a href="#"> <div class="am-btn am-btn-danger anniu"> 一键支付</div></a>';
        var state = '<p class="Mystatus">等待买家付款</p><p class="order-info"><a href="flashOrderInfo?orderNum=' + orderNum + '">查看订单详情</a></p>';

        if (orderstatus == 0) {//未付款
            anniu = '<a href="javascript:pay(' + flashorderid + ');" > <div class="am-btn am-btn-danger anniu"> 一键支付</div></a>';
            state = '<p class="Mystatus">等待买家付款</p><p class="order-info"><a href="flashOrderInfo?orderNum=' + orderNum + '">查看订单详情</a></p>';
        } else if (orderstatus == 1) {//已付款
            anniu = '';
            state = '<p class="Mystatus">等待发货</p><p class="order-info"><a href="flashOrderInfo?orderNum=' + orderNum + '">查看订单详情</a></p>';
        } else if (orderstatus == 2) {//已发货
            anniu = '<a href="javascript:sureGoods(' + flashorderid + ');" > <div class="am-btn am-btn-danger anniu"> 确认收货</div></a>';
            state = '<p class="Mystatus">已发货</p><p class="order-info"><a href="flashOrderInfo?orderNum=' + orderNum + '">查看订单详情</a></p>';
        } else if (orderstatus == 3) {//删除点单
            anniu = '<a href="javascript:deleteorder(' + flashorderid + ');" > <div class="am-btn am-btn-danger anniu"> 删除订单</div></a>';
            state = '<p class="Mystatus">交易完成</p><p class="order-info"><a href="flashOrderInfo?orderNum=' + orderNum + '">查看订单详情</a></p>';
        }


        $("#flashorderlist").append('<div class="order-status1">' +
            '<div class="order-title">' +
            '<div class="dd-num">订单编号：<a href="javascript:;">' + orderNum + '</a></div>' +
            '<span>下单时间：' + orderdata + '</span></div><div class="order-content">' +
            '<div class="order-left"><ul class="item-list"><li class="td td-item"><div class="item-pic">' +
            '<a href="#" class="J_MakePoint"><img src="' + priceurl + '" class="itempic J_ItemImg"></a>' +
            '</div><div class="item-info"><div class="item-basic-info">' +
            '<a href="#"><p>' + goodname + '</p><p class="info-little">所属分类：<a href="#">' + onelevelname + '</a>/<a href="#">' + twolevelname + '</a> </p></a></div></div> </li>' +
            '<li class="td td-price"><div class="item-price">' + surepice + '</div></li><li class="td td-number"><div class="item-number">' +
            '<span>×</span>' + sureshopnum + '</div></li><li class="td td-operation"><div class="item-operation">' +
            '</div></li></ul></div><div class="order-right"><li class="td td-amount">' +
            '<div class="item-amount">合计：' + allpice + '</div></li>' +
            '<div class="move-right"><li class="td td-status"><div class="item-status">' +
            state +
            '</div> </li><li class="td td-change">' + anniu + '</li></div></div></div></div>');
    }

    //*****************付款**********************
    function pay(flashorderid) {
        $.ajax({
            url: "${path}/flashorder.action/updateuserpay",
            type: "GET",
            data: {
                uid: "${user.userid}",
                foid: flashorderid
            },
            success: function (data) {
                //  alert(data)
                if (data.code == 0) {//有活动数据

                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg("支付成功", {icon: 1, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                    //alert(data.data);
                    // showtodayFlashSale(data.data);
                } else {//没有活动数据，返回错误信息
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg(data.msg, {icon: 2, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                    // alert(data.msg);
                }
            },
            error: function () {
                layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage, layer = layui.layer;
                    //  layer.msg('玩命提示中');
                    // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                    layer.msg("客户端请求异常", {icon: 2, time: 1200}, function () {
                        //进行页面刷新
                        getOrderMessage();
                    });
                })
                //alert("客户端请求有误");
            }
        });
    }

    //***************************确认收货*******************************
    function sureGoods(flashorderid) {

        $.ajax({
            url: "${path}/flashorder.action/updateusersurereceipt",
            type: "GET",
            data: {
                uid: "${user.userid}",
                foid: flashorderid
            },
            success: function (data) {
                //  alert(data)
                if (data.code == 0) {//有活动数据
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg("操作成功", {icon: 1, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                    //alert(data.data);
                    // showtodayFlashSale(data.data);
                } else {//没有活动数据，返回错误信息
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg(data.msg, {icon: 2, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                    //alert(data.msg);
                }
            },
            error: function () {
                //alert("客户端请求有误");
                layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage, layer = layui.layer;
                    //  layer.msg('玩命提示中');
                    // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                    layer.msg("客户端操作异常，删除失败", {icon: 2, time: 1200}, function () {
                        //进行页面刷新
                        getOrderMessage();
                    });
                })
            }
        });
    }

    //*****************************删除*****************
    function deleteorder(flashorderid) {
        $.ajax({
            url: "${path}/flashorder.action/deleteorderuser",
            type: "GET",
            data: {
                uid: "${user.userid}",
                foid: flashorderid
            },
            success: function (data) {
                //  alert(data)
                if (data.code == 0) {//有活动数据
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg("删除成功", {icon: 1, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                    //alert(data.data);
                    // showtodayFlashSale(data.data);
                } else {//没有活动数据，返回错误信息
                    //alert(data.msg);
                    layui.use(['laypage', 'layer'], function () {
                        var laypage = layui.laypage, layer = layui.layer;
                        //  layer.msg('玩命提示中');
                        // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                        layer.msg(data.msg, {icon: 2, time: 1200}, function () {
                            //进行页面刷新
                            getOrderMessage();
                        });
                    })
                }
            },
            error: function () {
                layui.use(['laypage', 'layer'], function () {
                    var laypage = layui.laypage, layer = layui.layer;
                    //  layer.msg('玩命提示中');
                    // layer.load(0, {shade: false});//0代表加载的风格，支持0-2
                    layer.msg("操作异常", {icon: 2, time: 1200}, function () {
                        //进行页面刷新
                        getOrderMessage();
                    });
                })
            }
        });
    }

</script>
<script type="text/javascript">

    function confirm1(orderid) {
        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage, layer = layui.layer;
            //  $("#confirm").click(function () {
            $.ajax({
                url: "${path}/user.action/confirmOrders",
                type: "post",
                data: {
                    "orderid": orderid
                }, success: function (data) {
                    if (data.msg == "收货成功") {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 2000}, function () {
                            location.reload();
                        });
                    }
                }
            });
        });
    }

    function deleteorder(orderid) {

        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage, layer = layui.layer;
            //  $("#confirm").click(function () {
            $.ajax({
                url: "${path}/user.action/deleteOrders",
                type: "post",
                data: {
                    "orderid": orderid
                }, success: function (data) {
                    if (data.msg == "删除成功") {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 2000}, function () {
                            location.reload();
                        });
                    }
                }
            });
        });
    }

</script>

</body>

</html>
